

#ifndef MAIN_H
#define MAIN_H


#include <iostream>
#include <time.h>
#include <chrono>
#include <ctime>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <iterator>
#include <string>
#include <vector>
#include <string.h>
#include "Task.h"
using namespace std;

class command{

public:

	/*	
	*	All possible command types
	*
	*	1. I included LOGIN, LOGOFF commands.
	*	2. EXIT is included since we don't want the program to stop after LOGOFF (for switching among users)
	*/
	enum COMMAND_TYPE {
		ADD, UPDATE, DELETE, SEARCH, SORT, VIEW, HELP, EXIT, LOGIN, LOGOFF, INVALID
	};

	static COMMAND_TYPE determineCommandType(string command);
	static void executeCommand(vector<string> command);




public:

	static string addParse(vector<string> command);
	static void updateParse(vector<string> command);
	static void deleteParse(vector<string> command);
	static void viewParse(vector<string> command);
	static void login(vector<string> userInfo);
	static void logoff();
	static int* search(string item);
	static void view(vector<string> command);
	static void help(string helpCommand);
	static void helpAll();




	static void showToUser(string output);
	static bool equalsIgnoreCase(const string& str1, const string& str2);
	static vector<string> spliter(string command, string delimiter);
	static string removeEnd(string str, string rmv);
	static string concat(string str1, string str2);
	static int* getDate();
	static int* getTime();
	static int* startToEnd(int startTime[]);
	static int* endToStart(int endTime[]);
	static int* dateParse(string date);
	static int* timeParse(string time);
	static Task access(int index);
};

#endif